#ifndef _QUATERION_H
#define _QUATERION_H
#include "..\common\def.h"
#include "vector.h"

struct EE_EXPORT QUATERNION
{
	float	x, y, z, w; 

	QUATERNION(void) : x(0.0F), y(0.0F), z(0.0F), w(1.0F)
	{ }

	QUATERNION(const float X, const float Y, const float Z, const float W) : x(X), y(Y), z(Z), w(W)
	{ }

	QUATERNION(const float * p) : x(p[0]), y(p[1]), z(p[2]), w(p[3])
	{ }

	float length(void); 

	static QUATERNION identity; 
	static void normalize(QUATERNION *q); 
	static QUATERNION normalOf(QUATERNION *q); 
	static void conjugate(QUATERNION *q); 
	static QUATERNION conjugateOf(QUATERNION *q); 
	static void RotateVector(const float angle, const Vector3f& axis, Vector3f* pInOut); 

	QUATERNION operator * (const QUATERNION &q) const; 
	QUATERNION operator = (const QUATERNION &q); 


	bool operator		== (const QUATERNION &q) const; 
	bool operator		!= (const QUATERNION &q) const; 

	operator float		*(); 
	operator float		* () const; 
}; 

#endif